<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 5.1.6 or newer
 *
 * @package		CodeIgniter
 * @author		ExpressionEngine Dev Team
 * @copyright	Copyright (c) 2008 - 2011, EllisLab, Inc.
 * @license		http://codeigniter.com/user_guide/license.html
 * @link		http://codeigniter.com
 * @since		Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * CodeIgniter Application Controller Class
 *
 * This class object is the super class that every library in
 * CodeIgniter will be assigned to.
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Libraries
 * @author		ExpressionEngine Dev Team
 * @link		http://codeigniter.com/user_guide/general/controllers.html
 */
class CI_Controller {

	private static $instance;

	/**
	 * Constructor
	 */
	public function __construct()
	{
		self::$instance =& $this;
		
		// Assign all the class objects that were instantiated by the
		// bootstrap file (CodeIgniter.php) to local class variables
		// so that CI can run as one big super object.
		foreach (is_loaded() as $var => $class)
		{
			$this->$var =& load_class($class);
		}
		
		
		$this->load =& load_class('Loader', 'core');

		$this->load->initialize();
		
		/*MODELS*/
		$this->load->model('Item_model' , 'mItem' ,TRUE);
		$this->load->model('Log' , 'log'  ,TRUE);
		$this->load->model('Page_model' , 'mPage'  ,TRUE);
		$this->load->model('User_model' , 'mUser' ,TRUE);
		$this->load->model('Business_nature_model', 'mBusinessnature' ,TRUE);
		$this->load->model('Tenant_model', 'mTenant', TRUE);
		$this->load->model('Category_model', 'mCategory', TRUE);
		$this->load->model('Deal_model', 'mDeal', TRUE);
		$this->load->model('Item_image_model', 'mItemImage', TRUE);
		$this->load->model('Deal_category_model', 'mDealCategory', TRUE);
		$this->load->model('Ordered_deal_model', 'mOrderedDeal', TRUE);
		$this->load->model('Address_book_model', 'mAddressBook', TRUE);
		$this->load->model('Payment_messages_model','mPaymentMessages', TRUE);
		/*LIBRARIES*/
		$this->load->library('session');
		$this->load->library('parser');
		$this->load->helper('ckeditor');
		$this->load->database();
		
		/*HELPERS*/
		$this->load->helper(array('url'));
		
		log_message('debug', "Controller Class Initialized");
	}

	public static function &get_instance()
	{
		return self::$instance;
	}
	
	

	
}
// END Controller class

/* End of file Controller.php */
/* Location: ./system/core/Controller.php */